﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IPagedList<sp_GetPartnerResult>>" %>
<div id="partner" class="partner">
    <ul>
        <%
            foreach (sp_GetPartnerResult item in ViewData.Model)
            {
        %>
        <li>
            <div class="cimage">
                <img src="<%=Constants.PHOTO_PATH_ROOT_PARTNER + item.Logo%>" width="208" height="132" /></div>
            <a class="textlink2 text" href="<%=FRouter._("cuahang",item.ID.ToString(),item.PartnerName) %>">
                <strong>
                    <%=Html.Encode(item.PartnerName)%></strong></a>
            <div class="style">
                <%=HttpUtility.HtmlEncode(item.Address)%>
                <br />
                Ðiện thoại:
                 <%=HttpUtility.HtmlEncode(item.Phone)%>
                <br />
                Giảm giá:
                 <%=HttpUtility.HtmlEncode(item.DiscountInfo)%>
            </div>
        </li>
         <% } %>
    </ul>
</div>
<div class="clrfix">
</div>
<div class="pagination">
    <%= Ajax.Pager(new AjaxOptions { UpdateTargetId = "partner", OnBegin = "beginPaging", OnSuccess = "successPaging", OnFailure = "failurePaging" },
                     ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount, new { controller = "CategoryView", action = "Index" })%>
</div>
<script type="text/javascript">

    function beginPaging(args) {
        // Animate
        $('#partner').fadeOut('normal');
    }

    function successPaging() {
        // Animate
        $('#partner').fadeIn('normal');
    }

    function failurePaging() {
        alert("Không có phần tử cho trang sau.");
    }
    </script>